<?php
/**
 * Model de planos.
 *
 * @author    Fernanda Rebelatto <fernanda.rebelatto@gmail.com>
 * @copyright Copyright (c) 2012
 * @version   0.1
 */

class Plano extends AppModel
{
    public function buscarPlanos($psCriterio)
    {
        if( trim( $psCriterio ) != '' )
        {
            return $this->all(array("conditions" => array($psCriterio)));
        }
        else
        {
            return $this->all();
        }
    }
    public function planoCliente($iPlanoId)
    {
        return $this->first(array("conditions" => array("plan_id" => $iPlanoId)));
    }
}

?>